package com.lhhu.demo.controller;

import com.lhhu.demo.bean.Logs;
import com.lhhu.demo.mapper.LogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther 虎
 * @Data 2021/4/9 18:18
 * @Version 1.0
 */
@RestController
public class LogController {
    @Autowired
    private LogMapper logMapper;

    @GetMapping("/getAllLogs")
    public List<Logs> getAllLogs(){
        return logMapper.getAllLogs();
    }

    @GetMapping("/getLogsByName")
    public List<Logs> getLogsMessageByName(String operitor){
        return logMapper.getLogsByName(operitor);
    }

    @GetMapping("/getLogsByTime")
    public List<Logs> getLogsMessageByTime(String begindate,String enddate){
        return logMapper.getLogsByTime(begindate,enddate);
    }

    @GetMapping("/getLogsByNameAndTime")
    public List<Logs> getLogsMessageByNameAndTime(String operitor,String begindate,String enddate){
        return logMapper.getLogsByNameAndTime(operitor,begindate,enddate);
    }
}
